home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / util / cli / UnixUtils.lha / UnixUtils / DIFF_README < prev    next >
Encoding:
Text File  |  1992-04-14  |  7.3 KB  |  199 lines

  1. This  is the port to SAS-C of the port of GNU diff to the Amiga ( :-),
  2. made  by  Martin  Hohl  in  September  1991,  with  a  couple  of bugs
  3. corrected (e.g.  == instead of =).  In the original Amiga.ReadMe file,
  4. Martin wrote:
  5.  
  6. -----
  7.  
  8. diff [options] file1 file2
  9.  
  10. GNU diff compares the both files given in the command line and outputs
  11. to the standard output, which lines have to be changed in which way to
  12. make the second file from the first file.
  13.  
  14. the most important options are:
  15.  
  16. diff -a file1 file2   treat everthing as ascii
  17. diff -d file1 file2   find the minimal set of differences
  18. diff -w file1 file2   ignore any changes in whitespace (tabs + blanks)
  19.  
  20. the output looks like:
  21. l1 a l2,l3           for lines which have to be added
  22. l1,l2 d l3           for lines which have to be deleted
  23. l1,l2 c l3,l4        for lines which have to be replaced
  24.  
  25.  
  26. Known bugs of this port:
  27. diff dir1 dir2        Compares of 2 directories does work, but only if
  28.                       neither dir1 or dir2 is the current directory
  29.                       ("" as argument to diff is not allowed for now)
  30.  
  31. This  port  was  done  with  GCC 1.37.1 (GNU-C for the Amiga, a highly
  32. optimizing  compiler,  which is free software), ported to the Amiga by
  33. Ray Burr, Sam Rushing and others.
  34.  
  35. The author can be reached via Email:
  36. zrzo0370@rusmv1.rus.uni-stuttgart.de
  37.  
  38. -----
  39.  
  40. Thanks, Martin! Here is some more info on the GNU diff program:
  41.  
  42. This  directory contains the GNU DIFF utility, version 1.15, ported to
  43. the  Amiga  for  the  SAS  C  compiler,  in  executable  form.  In the
  44. subdirectory named Source/Diff are these files:  the original GNU diff
  45. in  archived  form, GNUdiff.lha; the diff's between GNU diff and SAS C
  46. Amiga  diff  (Amiga.Patches); the SAS C Makefile; a new routine, named
  47. fixupname.c; and the GNU license with the copying conditions.
  48.  
  49. This  version of diff provides all the features of BSD's diff.  It has
  50. these additional features:
  51.  
  52. - An  input  file may end in a non-newline character.  If so, its last
  53.   line  is  called  an  incomplete line and is distinguished on output
  54.   from  a  full  line.   In  the default, -c, and -u output styles, an
  55.   incomplete  output line is followed by a diagnostic line that starts
  56.   with  \.   With  -n, an incomplete line is output without a trailing
  57.   newline.   Other  output  styles  (-D,  -e,  -f) cannot represent an
  58.   incomplete  line,  so  they pretend that there was a newline, and -e
  59.   and  -f  also  print an error message.  For example, suppose F and G
  60.   are one-byte files that contain just ``f'' and ``g'', respectively.
  61.  
  62.   Then ``diff F G'' outputs:
  63.  
  64.         1c1
  65.         < f
  66.         \ No newline at end of file
  67.         ---
  68.         > g
  69.         \ No newline at end of file
  70.  
  71.   (The  exact  diagnostic  message  may  differ, e.g.  for non-English
  72.   locales.)  ``diff  -n F G'' outputs the following without a trailing
  73.   newline:
  74.  
  75.         d1 1
  76.         a1 1
  77.         g
  78.  
  79.   ``diff -e F G'' sends two diagnostics to stderr and the following to
  80.   stdout:
  81.  
  82.         1c
  83.         g
  84.         .
  85.  
  86. - A  file  is considered to be text if its first characters are all in
  87.   the ISO 8859 character set; BSD's diff uses Ascii.
  88.  
  89. - An  input  file  may  end  in  a non-newline character.  With the -m
  90.   option,  an  incomplete  last  line  stays incomplete.  Other output
  91.   styles treat incomplete lines like diff.
  92.  
  93. - The file name '-' denotes the standard input.  It can appear at most
  94.   once.
  95.  
  96. GNU DIFF has the following options:
  97.  
  98. -a        Always treat files as text and compare them line-by-line,
  99.           even if they do not appear to be text.
  100.  
  101. -b        Ignore changes that affect only the amount of whitespace:
  102.  
  103. -B        Ignore changes that just insert or delete blank lines.
  104.  
  105. -c        Request context-style output.
  106.  
  107. -C #      Request -c format and specify number of context lines.
  108.  
  109. -d        Don't discard lines. This makes things slower, but will
  110.           find a _guaranteed minimal_ set of changes.
  111.  
  112. -D def    Make merged #ifdef-style output.
  113.  
  114. -e        Make output that is a valid Unix-ed script.
  115.  
  116. -f        Make output that looks vaguely like an Unix-ed script.
  117.  
  118. -F regexp In context format, for each unit of differences, show some
  119.           of the last preceding line that matches the specified
  120.           regexp.
  121.  
  122. -h        Split the files into chunks of about 1500 lines for faster
  123.           processing. Usually does not change the result.
  124.  
  125. -H        Use heuristics to speed handling of large files that have
  126.           numerous scattered small changes. The algorithm becomes
  127.           asymptotically linear for such files!
  128.  
  129. -i        Ignore case changes.
  130.  
  131. -I regexp Ignore changes that just insert or delete lines that match
  132.           the specified regexp.
  133.  
  134. -L label  Use the specified label in file header lines output by the
  135.           -c option. This option may be given zero, one, or two times,
  136.           to affect neither label, just the first file's label, or
  137.           both labels. A file's default label is its name, a tab, and
  138.           its modification date.
  139.  
  140. -n        Outputs RCS-style diffs, like `-f' except that each command
  141.           specifies the number of lines affected.
  142.  
  143. -N        In directory comparison, if a file is found in only one
  144.           directory, treat it as present but empty in the other
  145.           directory.
  146.  
  147. -p        Equivalent to -c -F'^[_a-zA-Z]'.  This is useful for C code
  148.           because it shows which function each change is in.
  149.  
  150. -q        Quiet running, print a message if the files differ.
  151.  
  152. -r        When comparing directories, recursively compare
  153.           subdirectories.
  154.  
  155. -s        Print a message if the files are the same.
  156.  
  157. -S        When comparing directories, start with the specified
  158.           file name.  This is used for resuming an aborted comparison.
  159.  
  160. -t        Expand tabs to spaces in the output so that it preserves
  161.           the alignment of the input files.
  162.  
  163. -T        Print a tab rather than a space before the text of a line
  164.           in normal or context format.  This causes the alignment
  165.           of tabs in the line to look normal.
  166.  
  167. -u[#]     Produce unified style output with # context lines (default
  168.           3). This style is like -c, but it is more compact because
  169.           context lines are printed only once.  Lines from just the
  170.           first file are marked '-'; lines from just the second file
  171.           are marked '+'.
  172.  
  173. -v        Print version number.
  174.  
  175. -w        Ignore horizontal whitespace when comparing lines.
  176.  
  177. GNU  DIFF  was  written by Mike Haertel, David Hayes, Richard Stallman
  178. and  Len  Tower.   The  basic  algorithm  is  described in:  "An O(ND)
  179. Difference  Algorithm  and its Variations", Eugene Myers, Algorithmica
  180. Vol.  1 No.  2, 1986, p 251.
  181.  
  182. Many bugs were fixed by Paul Eggert.  The unified diff idea and format
  183. are from Wayne Davison.
  184.  
  185. Suggested projects for improving GNU DIFF:
  186.  
  187. * Handle very large files by not keeping the entire text in core.  One
  188.   way  to  do  this  is  to scan the files sequentally to compute hash
  189.   codes  of  the  lines and put the lines in equivalence classes based
  190.   only  on  hash  code.   Then  compare the files normally.  This will
  191.   produce some false matches.
  192.  
  193. * Then  scan  the two files sequentially again, checking each match to
  194.   see  whether  it  is  real.  When a match is not real, mark both the
  195.   "matching" lines as changed.  Then build an edit script as usual.
  196.  
  197. * The  output  routines  would  have  to  be changed to scan the files
  198.   sequentially looking for the text to print.
  199.